package com.metadata_system.common.enums;

import java.util.HashMap;
import java.util.Map;

// 邮箱验证码-事件类型
public enum EmailVerifyEventType {
    login,
    register,
    resetPassword;


    private final static Map<String , EmailVerifyEventType> ENUM_MAP = new HashMap<String, EmailVerifyEventType>(64);

    static {
        for(EmailVerifyEventType v : values()) {
            ENUM_MAP.put(v.toString() , v);
        }
    }

    public static EmailVerifyEventType fromString(String v) {
        EmailVerifyEventType userOptionEnum = ENUM_MAP.get(v);
        return userOptionEnum == null ? login :userOptionEnum;
    }
}
